import { cafReq } from "..";
export const baseURL = `${import.meta.env.VITE_FIN_URL}/finance-user`;
// 查询角色列表
export const listRole = async (params?: any) => {
  return await cafReq(0, { baseURL }).post("/sys/role/search", params);
};

// 查询角色详细
export const getRole = async (businessId: string) => {
  return await cafReq(0, { baseURL }).get(`/sys/role/v1/get/${businessId}`);
};

// 新增角色
export const addRole = async (data: any) => {
  return await cafReq(0, { baseURL }).post(`/sys/role/v1/add`, data);
};

// 修改角色
export const updateRole = async (data: any) => {
  return await cafReq(0, { baseURL }).post(`/sys/role/v1/update`, data);
};

// 角色数据权限
export const dataScope = async (data?: any) => {
  console.log(data);
};

// 角色状态修改
// export const changeRoleStatus = async (roleId: string, status: number) => {
//   const data = {
//     roleId,
//     status,
//   };

// };

// 删除角色
export const delRole = async (roleId: string) => {
  return await cafReq(0, { baseURL }).delete(`/sys/role/v1/delete/${roleId}`);
};

// 查询角色已授权用户列表
export const allocatedUserList = async (params: any) => {
  console.log(params);
};

// 查询角色未授权用户列表
export const unallocatedUserList = async (params: any) => {
  console.log(params);
};

// 取消用户授权角色
export const authUserCancel = async (params: object) => {
  console.log("取消2", params);
};

// 批量取消用户授权角色
export const authUserCancelAll = async (params: object) => {
  console.log("取消1", params);
};

// 授权用户选择
export const authUserSelectAll = async (params: object) => {
  console.log("取消3", params);
};

// 根据角色ID查询部门树结构
export const deptTreeSelect = async (data?: any) => {
  console.log(data);
};
